import React, { Component } from 'react'
import { Route, Switch } from 'react-router-dom'
import Home from './pages/Home' //路由组件
import About from './pages/About'
import Header from './components/Header' // 一般组件
import MyNavLink from './components/MyNavLink'

export default class App extends Component {
  render() {
    return (
      <div className="container">
        <div className="col-xs-offset-2 col-xs-8">
          <div className="page-header">
            <Header />
          </div>
        </div>
        <div className="col-xs-2 col-xs-offset-2">
          <div className="list-group">
            <MyNavLink to="/bac/home">Home</MyNavLink>
            <MyNavLink to="/bac/about">About</MyNavLink>
          </div>
        </div>
        <div className="col-xs-6">
          <div className="panel-body">
            <Switch>
              <Route path="/bac/about" component={About}></Route>
              <Route path="/bac/home" component={Home}></Route>
            </Switch>
          </div>
        </div>
      </div>
    )
  }
}
